//
//  MBHTTPTool.h
//  MobellCloud_ios
//
//  Created by cherry pu on 2018/1/4.
//  Copyright © 2018年 zhangXin. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "MBHTTPResponse.h"


typedef void (^MBRequestSuccess)(id jsonData);
typedef void (^MBRequestFailure)(NSError *error);

typedef void (^MBResponseBlock)(MBHTTPResponse * response);

@interface MBHTTPTool : NSObject
+ (instancetype)sharedInstance;

//GET请求
- (void)GET:(NSString *)url params:(NSDictionary *)params success:(MBRequestSuccess)success failure:(MBRequestFailure)failure;

//POST请求
- (void)POST:(NSString *)url params:(NSDictionary *)params success:(MBRequestSuccess)success failure:(MBRequestFailure)failure;

//POST请求(上传文件)
- (void)POST:(NSString *)url params:(NSDictionary *)params withFileData:(NSData *)data andFileParamName:(NSString *)fileParamName success:(MBRequestSuccess)success failure:(MBRequestFailure)failure;

@end
